package com.atguigu.zuoye2;


import java.util.Scanner;

/**
 * @Description: 第二题
 * @Author: Hank
 * @Date: 2025/2/11 16:21
 */

public class Number {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        System.out.println("请输入一个数,判断奇偶");
        if (sc.hasNextDouble()){
            double num = sc.nextDouble();
            if (num == (int)num){
                if (num % 2 == 0){
                    System.out.println("是偶数");
                }else{
                    System.out.println("是奇数");
                }
            }else{
                System.out.println("请输入整数");
            }
        }else {
            System.out.println("请输入数字");
        }
    }
}

